Repository navigation
fix(cleanup): exit 0 and always clear busy under the runner's bash -e - #36
Merged
Merged
Conversation
The runner runs the JOB_COMPLETED hook under bash -e too. On a runner that never ran Gradle, `find ~/.gradle/caches` exits 1, the hook aborts, "Complete runner" fails the job, and `busy` is left behind, so every later job takes the crash-recovery path. Clear busy first, end every command in `|| true` and call the main path as `cleanup || true`. tests/cleanup.sh runs the hook under bash -e with and without a Gradle cache; it fails on the old hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #35, which fixed only the JOB_STARTED hook. This commit was pushed to that branch after it had been squash-merged, so it never reached
main.What breaks. The runner runs the JOB_COMPLETED hook under
bash -etoo. On a runner with no~/.gradle/caches(every control runner, and any runner that never ran Gradle),findexits 1. That has three effects:cleanup.shaborts;busyis left behind, so the next job takes the crash-recovery path. This is why fix(hooks): pre-job and cleanup exit 0 under the runner's bash -e #35 saw the sweep run on every control-runner job.Since the slots release (#31) this failed jobs on control and regular runners: smart-irrigation, nis-suite, kodni-mobile, infrasensing-senslogging.
Fix.
busyis cleared first.|| true.cleanup || true.Test.
tests/cleanup.shruns the hook underbash -ewith and without a Gradle cache. It stubsclean_tmp, so the test machine's/tmpis left alone. It fails on the old hook (4 checks) and passes on the new one. The full suite andshellcheck -xare clean.🤖 Generated with Claude Code